From ff633afac05c9bc680055ed5fb1f5432a850194e Mon Sep 17 00:00:00 2001 From: robertl Date: Fri, 18 Mar 2005 19:20:31 +0000 Subject: [PATCH] Don't leak on non-uniq blank names. Don't read past beginning of string on blank names after blank whacking applied. --- mkshort.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mkshort.c b/mkshort.c index 48ab322d8..1efcb7812 100644 --- a/mkshort.c +++ b/mkshort.c @@ -387,7 +387,7 @@ mkshort(void *h, const char *istring) * Walk in the Woods 2. */ np = ostring + strlen(ostring); - while (isdigit(*(np-1) )) { + while (*np && isdigit(*(np-1) )) { np--; } if (np) { @@ -407,6 +407,7 @@ mkshort(void *h, const char *istring) * let the must_uniq code handle it. */ if (ostring[0] == '\0') { + xfree(ostring); ostring = xstrdup("WPT"); } -- 2.30.2